package cn.damai.mine.md5;

import org.apache.commons.codec.digest.DigestUtils;

public class DigestUtilsMd5 {
	
	public static void main(String[] args) {
		
//		deviceType=102002&loginkey=18a158716a63498784b913c48dc94114_3_2&projectId=300862&registerPlatform=106003&sign=57f0ad153856d6f63bb69fd5d0df5a7b&starLevel=6
		
		long projectId = 124814;
		String loginkey = "f9e1962e74ce4cccac0e29c27009f215_3_3";
		String content = "想看啦啦啦啦啦啦啦啦";
		float starLevel = 4.0f;
		String ID_RSA = "1873a9009f524763ab43a76045ecaff4";
		
//		String sign = "d29918a6de0b544fd54e4f3e0873feac";
		
		String signStr = String.valueOf(projectId) + loginkey + content + starLevel
				+ ID_RSA;
		
		String md5sign = DigestUtils.md5Hex(signStr).toUpperCase();
		
		
		/*ProjectDramaticRest.addDramatic.param:projectId=124814,loginkey=f9e1962e74ce4cccac0e29c27009f215_3_3,
				deviceType=102003,registerPlatform=106003,content=有时间一定要去看  嗯嗯就这样,starLevel=4.0,
				sign=F475E1B2FD35E6D3E85A178343BBB308,41adb18316346ab7a47f3019543ecc96*/
		
		
		
		System.out.println(signStr);
		System.out.println(md5sign);
//		589D029F11B13467B0838B221889D7C0
		
		String tokenId = "ijqei11qsbjieb12j123k1n3k12jn31k3n1k21kj3b2kj12b";
		String ip = "192.168.1.1";
		String phone = "13000004322";
		
		md5sign = DigestUtils.md5Hex(
				tokenId.subSequence(0, tokenId.length() / 2) + ip + phone + ID_RSA).toUpperCase();
		System.out.println(md5sign);
		
		String md5sign1 = DigestUtils.md5Hex(
				"2312323" + phone + ID_RSA).toUpperCase();
		System.out.println(md5sign1);
	}

}
